Adaptive transform method based on in-screen prediction and apparatus using the method

ABSTRACT

Disclosed is an adaptive transform method based on an in-screen prediction, and an apparatus using the method. A method for encoding an image can comprise a step of determining in-screen prediction mode groups, and a step of transforming by using a different transform method according to the in-screen prediction mode group. As a result, transforming can be performed by applying the different transform method according to the in-screen prediction mode group.

CROSS REFERENCE TO RELATED APPLICATIONS

The application is a Continuation of U.S. patent application Ser. No.14/353,287 (filed on Apr. 21, 2014), which is a National Stage PatentApplication of PCT International Patent Application No.PCT/KR2012/006118 (filed on Aug. 1, 2012) under 35 U.S.C. §371, whichclaims priority to Korean Patent Application No. 10-2011-0106048 (filedon Oct. 17, 2011), the teachings of which are incorporated herein intheir entireties by reference.

TECHNICAL FIELD

The present invention relates to an adaptive transform method based onan intra prediction mode and an apparatus using the same, and moreparticularly, to an encoding/decoding method and apparatus.

BACKGROUND ART

Recently, demands for high-resolution and high-quality videos, such ashigh-definition (HD) and ultrahigh-definition (UHD) videos, haveincreased in various fields of applications. As video data has higherresolution and higher quality, the amount of data more increasesrelative to existing video data. Accordingly, when video data istransferred using media such as existing wired and wireless broad bandlines or is stored in existing storage media, transfer cost and storagecost increase. In order to solve these problems occurring with anincrease in resolution and quality of video data, high-efficiency videocompression techniques may be utilized.

Video compression technology include various techniques, such as aninter prediction technique of predicting pixel values included in acurrent picture from previous or subsequent pictures of the currentpicture, an intra prediction technique of predicting pixel valuesincluded in a current picture using pixel information in the currentpicture, and an entropy encoding technique of assigning a short code toa value with a high appearance frequency and assigning a long code to avalue with a low appearance frequency. Video data may be effectivelycompressed and transferred or stored using such video compressiontechniques.

DISCLOSURE Technical Problem

An aspect of the present invention is to provide a method of adaptivelychanging a transform mode based on an intra prediction mode to improveefficiency of video coding.

Another aspect of the present invention is to provide a method ofadaptively changing a scanning method based on an intra prediction modeto improve efficiency of video coding.

Still another aspect of the present invention is to provide an apparatusfor performing a method of adaptively changing a transform mode based onan intra prediction mode to improve efficiency of video coding.

Yet another aspect of the present invention is to provide an apparatusfor performing a method of adaptively changing a scanning method basedon an intra prediction mode to improve efficiency of video codingefficiency.

Technical Solution

An embodiment of the present invention provides a video decoding methodincluding determining an intra prediction mode of a block, andinverse-transforming the block using a different inverse transformmethod depending on the intra prediction mode of the block. Thedetermining of the intra prediction mode of the block may determinewhich intra prediction mode group the intra prediction mode of the blockis included in among a first intra prediction mode group including avertical prediction mode, a second intra prediction mode group includinga horizontal prediction mode, and a third intra prediction mode groupincluding any directional prediction mode other than the first intraprediction mode group and the second intra prediction mode group. Theinverse-transforming of the block using the different inverse transformmethod depending on the intra prediction mode of the block may dividethe intra prediction mode of the block into a plurality of predictionmode groups and determine an inverse transform method depending on theprediction mode groups. The video decoding method may further includedetermining whether to perform inverse transform on the block bydecoding flag information to determine whether to perform inversetransform on the block.

Another embodiment of the present invention provides a video decodingmethod including determining an intra prediction mode of a block, anddetermining a scanning order depending on the intra prediction mode ofthe block. The determining of the scanning order depending on the intraprediction mode of the block may divide the intra prediction mode of theblock into a plurality of prediction mode groups and determine ascanning order depending on the prediction mode groups.

Still another embodiment of the present invention provides an videoencoding method including determining an intra prediction mode of ablock, and transforming the block using a different transform methoddepending on the intra prediction mode of the block. The transforming ofthe block using the different transform method depending on the intraprediction mode of the block may divide the intra prediction mode of theblock into a plurality of prediction mode groups and determine atransform method depending on the prediction mode groups. The videoencoding method may further include determining whether to transform theblock and encoding information on whether to transform the block.

Yet another embodiment of the present invention provides a videoencoding method including determining an intra prediction mode of ablock, and determining a scanning order depending on the intraprediction mode of the block. The determining of the scanning orderdepending on the intra prediction mode of the block may divide the intraprediction mode of the block into a plurality of prediction mode groupsand determine a scanning order depending on the prediction mode groups.

Still another embodiment of the present invention provides a videodecoding apparatus including an entropy decoding module to decodeinformation on an intra prediction mode, and an inverse transform moduleto inverse-transform a block using a different inverse transform methodbased on the intra prediction mode decoded by the entropy decodingmodule. The inverse transform module may determine an inverse transformmethod depending on the intra prediction mode of the block divided intoa plurality of prediction mode groups. The entropy decoding module maydecode flag information to determine whether to perform inversetransform on the block.

Yet another embodiment of the present invention provides a videodecoding apparatus including an entropy decoding module to decodeinformation on an intra prediction mode, and a rearrangement module toscan a coefficient based on a scanning order determined on the intraprediction mode decoded by the entropy decoding module. Therearrangement module may perform scanning based on the intra predictionmode of the block divided into a plurality of prediction mode groups.

Still another embodiment of the present invention provides a videoencoding apparatus including a prediction module to determine an intraprediction mode of a block, and a transform module to transform theblock using a different transform method depending on the intraprediction mode of the block. The transform module may divide the intraprediction mode of the block into a plurality of prediction mode groupsand determine a transform method depending on the prediction modegroups. The transform module may determine whether to transform theblock.

Yet another embodiment of the present invention provides a videoencoding apparatus including a prediction module to determine an intraprediction mode of a block, and a rearrangement module to scan andrearrange a coefficient of the block based on a scanning orderdetermined on the intra prediction mode of the block.

Advantageous Effects

According to exemplary embodiments of the present invention, an adaptivetransform method based on an intra prediction mode and an apparatususing the same may divide intra prediction modes into groups and performtransform using different transform methods depending on the intraprediction modes. Thus, operation complexity may be reduced andefficient transform may be achieved.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating a video encoding apparatusaccording to an exemplary embodiment of the present invention.

FIG. 2 is a block diagram illustrating a video decoding apparatusaccording to an exemplary embodiment of the present invention.

FIG. 3 illustrates a method of changing a transform method depending onan intra prediction mode according to an exemplary embodiment of thepresent invention.

FIG. 4 illustrates a transform method according to an exemplaryembodiment of the present invention.

FIG. 5 illustrates a transform method depending on an intra predictionmode according to an exemplary embodiment of the present invention.

FIG. 6 is a flowchart illustrating a method of selecting a differenttransform method depending on an intra prediction mode according to anexemplary embodiment of the present invention.

FIG. 7 illustrates a method of reallocating a codeword depending on anintra prediction mode according to an exemplary embodiment of thepresent invention.

FIG. 8 illustrates a scanning mode depending on a transform methodaccording to an exemplary embodiment of the present invention.

FIG. 9 is a flowchart illustrating a method of determining a scanningmode depending on a transform method according to an exemplaryembodiment of the present invention.

FIG. 10 is a flowchart illustrating a method of determining a scanningmode depending on a transform method according to an exemplaryembodiment of the present invention.

MODE FOR INVENTION

The present invention may be changed and modified variously and beillustrated with reference to different exemplary embodiments, some ofwhich will be described and shown in the drawings. However, theseembodiments are not intended for limiting the invention but areconstrued as including includes all modifications, equivalents andreplacements which belong to the spirit and technical scope of theinvention. Like reference numerals in the drawings refer to likeelements throughout.

Although the terms first, second, etc. may be used to describe variouselements, these elements should not be limited by these terms. Theseterms are used only to distinguish one element from another element. Forexample, a first element could be termed a second element and a secondelement could be termed a first element likewise without departing fromthe teachings of the present invention. The term “and/or” includes anyand all combinations of a plurality of associated listed items.

It will be understood that when an element is referred to as being“connected to” or “coupled to” another element, the element can bedirectly connected or coupled to another element or interveningelements. On the contrary, when an element is referred to as being“directly connected to” or “directly coupled to” another element, thereare no intervening elements present.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a,” “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “include” and/or“have,” when used in this specification, specify the presence of statedfeatures, integers, steps, operations, elements, and/or components, butdo not preclude the presence or addition of one or more other features,integers, steps, operations, elements, components, and/or groupsthereof.

Hereinafter, exemplary embodiments of the invention will be described indetail with reference to the accompanying drawings. Like referencenumerals in the drawings refer to like elements throughout, andredundant descriptions of like elements will be omitted herein.

FIG. 1 is a block diagram illustrating a video encoding apparatusaccording to an exemplary embodiment of the present invention.

Referring to FIG. 1, the video encoding apparatus 100 includes a picturepartitioning module 105, a prediction module 110, a transform module115, a quantization module 120, a rearrangement module 125, an entropyencoding module 130, a dequantization module 135, an inverse transformmodule 140, a filter module 145 and a memory 150.

Although elements illustrated in FIG. 1 are independently shown so as torepresent different distinctive functions in the video encodingapparatus, such a configuration does not indicate that each element isconstructed by a separate hardware constituent or software constituent.That is, the elements are independently arranged for convenience ofdescription, wherein at least two elements may be combined into a singleelement, or a single element may be divided into a plurality of elementsto perform functions. It is to be noted that embodiments in which someelements are integrated into one combined element and/or an element isdivided into multiple separate elements are included in the scope of thepresent invention without departing from the essence of the presentinvention.

Some elements may not be essential to the substantial functions in theinvention and may be optional constituents for merely improvingperformance. The invention may be embodied by including onlyconstituents essential to embodiment of the invention, except forconstituents used to merely improve performance. The structure includingonly the essential constituents except for the optical constituents usedto merely improve performance belongs to the scope of the invention.

The picture partitioning module 105 may partition an input picture intoat least one process unit. Here, the process unit may be a predictionunit (PU), a transform unit (TU) or a coding unit (CU). The picturepartitioning module 105 may partition one picture into a plurality ofcombinations of coding units, prediction units and transform units andselect one combination of coding units, prediction units and transformunits on the basis of a predetermined criterion (for example, a costfunction), thereby encoding the picture.

For example, one picture may be partitioned into a plurality of codingunits. A recursive tree structure such as a quad tree structure may beused to partition a picture into coding units. Being a picture or acoding unit of a maximum size as root, a coding unit may be partitionedinto sub-coding units with as many child nodes as the partitioned codingunits. A coding unit which is not partitioned any more in accordancewith a predetermined constraint is to be a leaf node. That is, assumingthat a coding unit may be partitioned into quadrates only, a singlecoding unit may be partitioned into at most four different coding units.

In the embodiments of the invention, a coding unit may be used to referto not only a unit of encoding but also a unit of decoding.

A prediction unit may be partitioned into at least one square orrectangular form with the same size in a coding unit or be partitionedsuch that a shape of partitioned prediction unit is different from ashape of other prediction unit in a coding unit.

When a prediction unit to be subjected to intra prediction is generatedbased on a coding unit and the coding unit is not a minimum coding unit,intra prediction may be performed without partitioning the coding unitinto plural prediction units (N×N).

The prediction module 110 may include an inter prediction module toperform inter prediction and an intra prediction module to perform intraprediction. The prediction module 110 may determine which of interprediction or intra prediction should be performed on a prediction unit,and may determine specific information (for example, intra predictionmode, motion vector, and reference picture, etc) according to thedetermined prediction method. Here, a process unit on which predictionis performed may be different from a process unit for which a predictionmethod and specific information are determined. For example, aprediction method and a prediction mode may be determined for eachprediction unit, while prediction may be performed for each transformunit. A residual value (residual block) between a generated predictedblock and an original block may be input to the transform module 115.Further, prediction mode information, motion vector information and thelike used for prediction may be encoded along with the residual value bythe entropy encoding module 130 and be transmitted to the decodingapparatus. When a specific encoding mode is used, the original block maybe encoded and transmitted to the decoding apparatus without generatinga predicted block through the prediction module 110.

The inter prediction module may predict for a prediction unit on thebasis of information on at least one picture among a previous pictureand a subsequent picture of a current picture. The inter predictionmodule may include a reference picture interpolation module, a motionprediction module, and a motion compensation module.

The reference picture interpolation module may be supplied withreference picture information from the memory 150 and generate pixelinformation less than an integer pixel position unit (an integer pixelunit or a pixel unit) from a reference picture. In the case of lumapixels, a DCT-based 8-tap interpolation filter having a varying filtercoefficient may be used to generate pixel information less than aninteger pixel unit in a unit of ¼ pixel position (a unit of ¼ pixel). Inthe case of chroma pixels, a DCT-based 4-tap interpolation filter havinga varying filter coefficient may be used to generate pixel informationless than an integer pixel unit in a unit of ⅛ pixel position (a unit of⅛ pixel).

The motion prediction module may perform motion prediction on the basisof the reference picture interpolated by the reference pictureinterpolation module. Various methods, such as a full search-based blockmatching algorithm (FBMA), a three-step search (TSS) algorithm and a newthree-step search (NTS) algorithm, may be used to calculate a motionvector. A motion vector may have a motion vector value in a unit of ½ or¼ pixel on the basis of an interpolated pixel. The motion predictionmodule may perform a prediction on a current prediction unit usingdifferent motion prediction methods. Various methods, such as skipping,merging, and advanced motion vector prediction (AMVP) etc, may be usedas the motion prediction method.

The intra prediction module may generate a prediction block based onreference pixel information neighboring to a current block which ispixel information in a current picture. When a block neighboring to acurrent prediction unit is a block having been subjected to interprediction and a reference pixel is a pixel having been subjected tointer prediction, reference pixel information included in the blockhaving been subjected to inter prediction may be substituted withreference pixel information in a block having been subjected to intraprediction. That is, when a reference pixel is not available,information on the unavailable reference pixel may be substituted withat least one reference pixel of the available reference pixels.

A prediction mode of intra prediction may include a directionalprediction mode in which reference pixel information is used accordingto a prediction direction and a non-directional prediction mode in whichdirection information is not used in performing prediction. A mode forpredicting luma information and a mode for predicting chroma informationmay be different from each other. Intra prediction mode information usedto obtain luma information or predicted luma signal information may beused to predict chroma information.

When a prediction unit and a transform unit have the same size inperforming intra prediction, intra prediction on the prediction unit maybe performed based on left pixels, an upper-left pixel and upper pixelsof the prediction unit. On the other hand, when a prediction unit and atransform unit have different sizes in performing intra prediction,intra prediction may be performed using reference pixels based on thetransform unit. Intra prediction with N×N partitioning may be performedonly on a minimum coding unit.

In the intra prediction method, an adaptive intra smoothing (AIS) filtermay be applied to reference pixels according to the prediction modeprior to generation of a predicted block. Different types of AIS filtersmay be applied to the reference pixels. In the intra prediction method,the intra prediction mode of a current prediction unit may be predictedfrom an intra prediction mode of a prediction unit located neighboringto the current prediction unit. In predicting for the prediction mode ofthe current prediction unit using mode information predicted from aneighboring prediction unit, when the current prediction unit and theneighboring prediction unit have the same intra prediction mode,information indicating that the current prediction unit and theneighboring prediction unit have the same prediction mode may betransmitted using predetermined flag information. If the currentprediction unit and the neighboring prediction unit have differentprediction modes, information on the prediction mode of the currentblock may be encoded by entropy encoding.

A residual block including residual information which is a differencebetween the predicted block and the original block of the predictionunit may be generated based on the prediction unit by the predictionmodule 110. The generated residual block may be input to the transformmodule 115. The transform module 115 may transform the residual blockincluding the residual information of the prediction unit generatedbased on the original block by the prediction module 110 using atransform method such as Discrete Cosine Transform (DCT) or DiscreteSine Transform (DST). A transform method to be used to transform theresidual block may be determined among DCT and DST on the basis of theintra prediction mode information of the prediction unit used togenerate the residual block.

An intra prediction mode for a current transform unit may be dividedinto a first intra prediction mode group including a vertical predictionmode, a second intra prediction mode group including a horizontalprediction mode, and a third intra prediction mode group including anydirectional prediction mode other than the first intra prediction modegroup and the second intra prediction mode group. The transform module115 may determine an intra prediction mode group and performtransformation using different transform methods depending on intraprediction mode groups.

The quantization module 120 may quantize values transformed into afrequency domain by the transform module 115. A quantization parametermay change depending on a block or importance of a picture. Valuesoutput from the quantization module 120 may be provided to thedequantization module 135 and the rearrangement module 125.

For the quantized residual values, the rearrangement module 125 mayrearrange coefficients.

The rearrangement module 125 may change a two-dimensional (2D) block ofcoefficients into a one-dimensional (1D) vector of coefficients throughcoefficient scanning. For example, the rearrangement module 125 maychange a 2D block of coefficients into a 1D vector of coefficients usingdiagonal scanning. Vertical scanning for scanning a 2D block ofcoefficients in a column direction and horizontal scanning for scanninga 2D block of coefficients in a row direction may be used depending on asize of a transform unit and an intra prediction mode, instead ofdiagonal scanning. That is, a scanning method for use may be selectedbased on the size of the transform unit and the intra prediction modeamong diagonal scanning, vertical scanning, and horizontal scanning.

The entropy encoding module 130 may perform entropy encoding on thebasis of the values obtained by the rearrangement module 125. Variousencoding methods, such as exponential Golomb coding, context-adaptivevariable length coding (CAVLC), and context-adaptive binary arithmeticcoding (CABAC), may be used for entropy encoding.

The entropy encoding module 130 may encode a variety of information,such as residual coefficient information and block type information on acoding unit, prediction mode information, partitioning unit information,prediction unit information, transfer unit information, motion vectorinformation, reference frame information, block interpolationinformation and filtering information which may be obtained from therearrangement module 125 and the prediction module 110.

The entropy encoding module 130 may entropy-encode coefficients of acoding unit input from the rearrangement module 125.

The entropy encoding module 130 may store a table for entropy encoding,such as a variable-length coding (VLC) table, and entropy-encode usingthe VLC table. In entropy encoding, a method of using a counter for somecodewords included in the table or direct swapping method may be used tochange assignment of a codeword to a code number of information. Forinstance, in higher code numbers to which short-bit codewords isassigned in a table mapping a code number and a codeword, mapping orderof the table mapping the codeword and the code number may be adaptivelychanged so as to assign a short-length codeword to a code number havinga highest number of counting times of code numbers using a counter. Whena number of counting times by the counter is a preset threshold, thenumber of counting times recorded in the counter may be divided in half,followed by counting again.

A code number in the table which is not counted may be subjected toentropy encoding by reducing a bit number assigned to the code numbervia a method of swapping a position with a right higher code numberusing the direct swapping method when information corresponding to thecode number occurs.

The entropy encoding module may use different mapping tables forencoding a transform method depending on the intra prediction modegroups.

The dequantization module 135 and the inverse transform module 140dequantize the values quantized by the quantization module 120 andinversely transform the values transformed by the transform module 115.The residual values generated by the dequantization module 135 and theinverse transform module 140 may be added to the predicted block, whichis predicted by the motion prediction module, the motion compensationmodule, and the intra prediction module of the prediction module 110,thereby generating a reconstructed block.

The filter module 145 may include at least one of a deblocking filter,an offset correction module, and an adaptive loop filter (ALF).

The deblocking filter 145 may remove block distortion generated atboundaries between blocks in a reconstructed picture. Whether to applythe deblocking filter to a current block may be determined on the basisof pixels included in several rows or columns of the block. When thedeblocking filter is applied to a block, a strong filter or a weakfilter may be applied depending on a required deblocking filteringstrength. In addition, when horizontal filtering and vertical filteringare performed in applying the deblocking filter, the horizontalfiltering and vertical filtering may be performed in parallel.

The offset correction module may correct an offset of the deblockingfiltered picture from the original picture by a pixel. A method ofpartitioning pixels of a picture into a predetermined number of regions,determining a region to be subjected to offset correction, and applyingoffset correction to the determined region or a method of applyingoffset correction in consideration of edge information on each pixel maybe used to perform offset correction on a specific picture.

The ALF may perform filtering based on a comparison result of thefiltered reconstructed picture and the original picture. Pixels includedin a picture may be partitioned into predetermined groups, a filter tobe applied to each group may be determined, and differential filteringmay be performed for each group. Information on whether to apply the ALFmay be transferred by each coding unit (CU) and a shape and coefficientof an ALF to be applied to each block may vary. The ALF may have varioustypes and a number of coefficients included in a corresponding filtermay vary. Filtering-related information on the ALF, such as filtercoefficient information, ALF ON/OFF information, and filter typeinformation, may be included and transferred in a predeterminedparameter set of a bitstream.

The memory 150 may store a reconstructed block or picture output fromthe filter module 145, and the stored reconstructed block or picture maybe provided to the prediction module 110 when performing interprediction.

FIG. 2 is a block diagram illustrating a video decoding apparatusaccording an exemplary embodiment of the present invention.

Referring to FIG. 2, the video decoding apparatus 200 may include anentropy decoding module 210, a rearrangement module 215, adequantization module 220, an inverse transform module 225, a predictionmodule 230, a filter module 235, and a memory 240.

When a video bitstream is input from the video encoding apparatus, theinput bitstream may be decoded according to an inverse process of thevideo encoding process by the video encoding apparatus.

The entropy decoding module 210 may perform entropy decoding accordingto an inverse process of the entropy encoding process by the entropyencoding module of the video encoding apparatus. For example, the sameVLC table as used for entropy encoding in the video encoding apparatusmay be used to perform entropy decoding. Information for generating aprediction block among information decoded in the entropy decodingmodule 210 may be provided to the prediction module 230, and residualvalues obtained via entropy decoding by the entropy decoding module maybe input to the rearrangement module 215.

Like the entropy encoding module, the entropy decoding module 210 mayalso change a codeword assignment table using a counter or directswapping method and perform entropy decoding based on the changedcodeword assignment table.

The entropy decoding module 210 may decode information associated withintra prediction and inter prediction performed by the encodingapparatus. As described above, when the video encoding apparatus haspredetermined constraints in performing intra prediction and interprediction, the entropy decoding module may perform entropy decodingbased on the constraints to obtain information on intra prediction andinter prediction of a current block.

The rearrangement module 215 may perform rearrangement on the bitstreamentropy-decoded by the entropy decoding module 210 on the basis of therearrangement method of the encoding module. The rearrangement module215 may reconstruct and rearrange coefficients expressed in a 1D vectorform into coefficients in a 2D block. The rearrangement module 215 maybe provided with information associated with coefficient scanningperformed by the encoding module and may perform rearrangement using amethod of inversely scanning the coefficients on the basis of scanningorder by which scanning is performed by the encoding module.

The dequantization module 220 may perform dequantization on the basis ofa quantization parameter provided from the encoding apparatus and therearranged coefficients of the block.

The inverse transform module 225 may perform inverse DCT and inverse DSTwith respect to DCT and DST performed by the transform module, where theDCT and DST have been performed on the result of quantization by thevideo encoding apparatus. Inverse transform may be performed on thebasis of a transfer unit determined by the video encoding apparatus. Thetransform module of the video encoding apparatus may selectively performDCT and DST depending on a plurality of information elements, such as aprediction method, a size of the current block and a predictiondirection, etc, and the inverse transform module 225 of the videodecoding apparatus may perform inverse transform on the basis ofinformation on the transform performed by the transform module of thevideo encoding apparatus.

Transform may be performed by a coding unit instead of by a transformunit.

An intra prediction mode for a current transform unit may be dividedinto a first intra prediction mode group including a vertical predictionmode, a second intra prediction mode group including a horizontalprediction mode, and a third intra prediction mode group including anydirectional prediction mode other than the first intra prediction modegroup and the second intra prediction mode group. The inverse transformmodule 225 may determine an intra prediction mode group and performinverse transformation using different transform methods depending onintra prediction mode groups.

In decoding a transform method, the transform method is decoded using afirst mapping table when the intra prediction mode group is the firstintra prediction mode group, the transform method is decoded using asecond mapping table when the intra prediction mode group is the secondintra prediction mode group, and the transform method is decoded using athird mapping table when the intra prediction mode group is the thirdintra prediction mode group.

The prediction module 230 may generate a predicted block on the basis ofpredicted block generation information provided from the entropydecoding module 210 and information on a previously-decoded block orpicture provided from the memory 240.

Similarly to the operation of the video encoding apparatus as describedabove, when a prediction unit and a transform unit have the same size inperforming intra prediction, intra prediction on the prediction unit isperformed based on left pixels, an upper-left pixel and upper pixels ofthe prediction unit. On the other hand, when a prediction unit and atransform unit have different sizes in performing intra prediction,intra prediction may be performed using reference pixels based on thetransform unit. Intra prediction with N×N partitioning may be performedonly on a minimum coding unit.

The prediction module 230 may include a prediction unit determinationmodule, an inter prediction module and an intra prediction module. Theprediction unit determination module may receive a variety ofinformation, such as prediction unit information, prediction modeinformation of an intra prediction method and motion prediction-relatedinformation of an inter prediction method input from the entropydecoding module, may determine a prediction unit in a current codingunit, and may determine which of the inter prediction and the intraprediction is performed on the prediction unit. The inter predictionmodule may perform inter prediction on a current prediction unit basedon information of at least one picture among a previous picture and asubsequent picture of a current picture including the current predictionunit using information necessary for inter prediction of the currentprediction unit provided from the video encoding apparatus.

In order to perform inter prediction, it may be determined on the basisof a coding unit whether a motion prediction method for a predictionunit included in the coding unit is a skip mode, a merge mode or an AMVPmode.

The intra prediction module may generate a predicted block on the basisof pixel information in a current picture. When a prediction unit is aprediction unit on which intra prediction is performed, intra predictionmay be performed based on intra prediction mode information on theprediction unit provided from the video encoding apparatus. The intraprediction module may include an MS filter, a reference pixelinterpolation module, and a DC filter. The AIS filter performs filteringon reference pixels of a current block, and whether to apply the AISfilter may be determined depending on a prediction mode of the currentprediction unit. AIS filtering may be performed on the reference pixelsof the current block using the prediction mode of the prediction unitand information on the AIS filter provided from the video encodingapparatus. When the prediction mode of the current block is a mode notinvolving AIS filtering, the AIS filter may not be applied.

When the prediction mode of the prediction unit is a prediction mode ofperforming intra prediction on the basis of pixel values obtained byinterpolating the reference pixels, the reference pixel interpolationmodule may generate reference pixels in a pixel unit of less than aninteger position unit by interpolating the reference pixels. When theprediction mode of the current prediction unit is a prediction mode ofgenerating a predicted block without interpolating the reference pixels,the reference pixels may not be interpolated. The DC filter may generatea predicted block through filtering when the prediction mode of thecurrent block is the DC mode.

The reconstructed block or picture may be provided to the filter module235. The filter module 235 may include a deblocking filter, an offsetcorrection module, and an ALF.

Information on whether the deblocking filter is applied to acorresponding block or picture and information on which of a strongfilter and a weak filter is applied when the deblocking filter is usedmay be provided from the video encoding apparatus. The deblocking filterof the video decoding apparatus may be provided with information on thedeblocking filter from the video encoding apparatus and may performdeblocking filtering on a corresponding block. Similarly to the videoencoding apparatus, vertical deblocking filtering and horizontaldeblocking filtering are performed first, in which at least one ofvertical deblocking filtering and horizontal deblocking filtering may beperformed on an overlapping region. Either of vertical deblockingfiltering and horizontal deblocking filtering which is not previouslyperformed may be performed on the region in which vertical deblockingfiltering and horizontal deblocking filtering overlap. This deblockingfiltering process may enable parallel processing of deblockingfiltering.

The offset correction module may perform offset correction on thereconstructed picture on the basis of an offset correction type andoffset value information applied to the picture in the encoding process.

The ALF may perform filtering on the basis of a comparison resultbetween the reconstructed picture after filtering and the originalpicture. The ALF may be applied to a coding unit on the basis ofinformation on whether the ALF is applied or not, and ALF coefficientinformation provided from the encoding apparatus. The ALF informationmay be included and provided in a specific parameter set.

The memory 240 may store the reconstructed picture or block for use as areference picture or a reference block, and may provide thereconstructed picture to an output module.

As described above, in the embodiments of the invention, the term“coding unit” is used as an encoding unit and may be also used as a unitof decoding (decoding unit).

FIG. 3 illustrates a method of changing a transform method depending onan intra prediction mode according to an exemplary embodiment of thepresent invention.

Referring to FIG. 3, different transform methods may be used dependingon direction of an intra prediction mode.

A first intra prediction mode group 300 includes a vertical intraprediction mode 26 and adjacent modes 23, 24, 25, 27, 28 and 29. Asecond intra prediction mode group 320 includes a horizontal intraprediction mode 10 and adjacent modes 13, 12, 11, 9, 8 and 7. A thirdintra prediction mode group 340 includes diagonal prediction modes otherthan the first intra prediction mode group 300 and the second intraprediction mode group 320.

The first intra prediction mode group 300, the second intra predictionmode group 320 and the third intra prediction mode group 340 have valuesset at random. In the transform method depending on the intra predictionmode according to the present embodiment, other prediction modes may beincluded in the corresponding groups. That is, the first intraprediction mode group 300 represents a group including intra predictionmodes with a high vertical prediction tendency and the second intraprediction mode group 320 represents a group including intra predictionmodes with a high horizontal prediction tendency. An intra predictionmode included in a corresponding group may be changed within the scopeof the present invention.

That is, in the transform method according to the present embodiment,intra prediction modes are divided into groups and different transformmethods are applied depending on the groups, in which intra predictionmodes may also be divided into a plurality of groups, instead of threegroups, and different transform methods may be applied depending on thegroups.

FIG. 4 illustrates a transform method according to an exemplaryembodiment of the present invention.

Referring to FIG. 4, four transform methods may be used to transform aresidual signal.

The transform methods to be mentioned below may be classified accordingto whether row transformation and column transformation are performed ona block. In decoding process, inverse transform may be performed withrespect to a transform method used for transformation in encodingprocess. Hereinafter, the present embodiment illustrates a transformmethod for encoding process only for convenience of description. Indecoding process, inverse transform may be carried out on the basis ofthe transform method in encoding process.

A first transform method 400 performs both row transformation and columntransformation, and may perform 2-directional (2D) transformation on ablock.

A second transform method 420 performs row transformation only, and mayperform 1-directional (1D) transformation on a block in a row direction.A third transform method 440 performs column transformation only, andmay perform 1-directional transformation on a block in a columndirection.

A fourth transform method 460 may perform neither row nor columntransformation. The fourth transform method may be expressed based onpredetermined flag information, the flag information may specify thattransformation is not perform on a current block. Further, in encodingprocess, information on whether a non-transform (transform skip) methodsuch as the fourth transform method is used for an entire encodingprocess may be indicated with additional flag information.

In the present embodiment, only some of the first to fourth transformmethods may be selectively used, instead of using all first to fourthtransform methods. For example, the fourth transform method that is anon-transform method may be selectively used using flag information.That is, in transforming a block, only the first to third transformmethods may be used and the fourth transform method may be selectivelyused. Alternatively, when only the first transform method and the fourthtransform method are used, only the first transform method may beselectively used using flag information, or the first transform methodor both the first transform method and the fourth transform method maybe used.

Table 1 shows the transform methods and codewords representing thetransform methods.

TABLE 1 Row Column transfor- transfor- Code- Transform method mationmation word First transform method 0 0 1 2D transform Second transformmethod 0 — 01 1D transform Third transform method — 0 001 1D transformFourth transform method — — 000 Non- transform

In the transform method according to the present embodiment, differenttransform methods may be applied depending on intra prediction modes.

FIG. 5 illustrates a transform method depending on an intra predictionmode according to an exemplary embodiment of the present invention.

For convenience of description, the following embodiment shows thatintra prediction modes are classified into three intra predictions modegroups and different transform methods are used for the respectivegroups. However, this embodiment is provided as an illustrative exampleonly to show that intra prediction modes are divided into a plurality ofprediction mode groups and a transform method is applied based on thedivided groups. Alternative embodiments illustrating that intraprediction modes are divided into a plurality of prediction mode groupsand a transform method may be applied based on the divided groups fallwithin the scope of the present invention.

Referring to FIG. 5, a first intra prediction mode group 500 including avertical prediction mode and adjacent prediction modes may use thesecond transform method of performing 1D transformation in the rowdirection.

A second intra prediction mode group 520 including a horizontalprediction mode and adjacent prediction modes may use the thirdtransform method of performing 1D transformation in the columndirection.

A third intra prediction mode group 540 may perform transform usingeither the first transform method of performing 2D transformation inboth row and column directions or the fourth transform method of notperforming transform in any direction.

A DC mode or planar mode as a non-directional mode may select and use atransform method with a small rate-distortion optimization (RDO) valueamong the first to fourth transform methods.

In decoding process, the same transform method used for encoding processmay be used to perform inverse transform for a prediction mode group.

That is, according to the present embodiment,

(1) In encoding process, intra prediction mode information may bederived and a transform method may be selectively used based on thederived intra prediction mode information. The intra prediction modeinformation may be information indicating in which prediction mode groupthe intra prediction mode is included;

(2) In decoding process, the intra prediction mode information may bedecoded. Inverse transform may be performed based on the decoded intraprediction mode information using a transform method used for encodingprocess, thereby reconstructing a block.

FIG. 6 is a flowchart illustrating a method of selecting a differenttransform method depending on an intra prediction mode according to anexemplary embodiment of the present invention.

Hereinafter, FIG. 6 illustrates a method of selectively using some ofthe transform methods depending on an intra prediction mode according toan exemplary embodiment.

Referring to FIG. 6, it is determined which intra prediction mode groupa current intra prediction mode is included in (S600).

In the first intra prediction mode group (S610), the third transformmethod of performing 1D transformation only in the column direction isless likely to have best performance in view of RDO. Thus, in performingintra prediction, transform may be performed using at least one of thefirst transform method, the second transform method and the fourthtransform method, other than the third transform method, to compare RDO.Among these transform methods, a transform method with best performancemay be selected as a transform method for a current transform unit toperform transform (S640).

In the second intra prediction mode group (S620), the second transformmethod of performing 1D transformation only in the row direction is lesslikely to have best performance in view of RDO. Thus, in performingintra prediction, transform may be performed using at least one of thefirst transform method, the third transform method and the fourthtransform method, other than the second transform method, to compareRDO. Among these transform methods, a transform method with bestperformance may be selected as a transform method for a currenttransform unit to perform transform (S650).

In the third intra prediction mode group (S630), transform may beperformed using one selected of the first transform method and thefourth transform method, other than the second transform method ofperforming 1D transformation in the row direction and the thirdtransform method of performing 1D transformation in the column direction(S660).

Tables 2 to 4 illustrate different sets of transform methods to be usedfor the respective intra prediction mode groups according to theexemplary embodiment of the present invention.

TABLE 2 Row Column transfor- transfor- Code- Transform method mationmation word First transform method 0 0 0 2D transform Second transformmethod 0 — 10 1D transform Fourth transform method — — 11

Table 2 illustrates a set of transform methods used for the first intraprediction mode group, in which one of the three transform methods otherthan the third transform method of performing only column transformationmay be selectively used.

TABLE 3 Row Column transfor- transfor- Code- Transform method mationmation word First transform method 0 0 0 2D transform Third transformmethod — 0 10 1D transform Fourth transform method — — 11

Table 3 illustrates a set of transform methods used for the second intraprediction mode group, in which one of the three transform methods otherthan the second transform method of performing only row transformationmay be selectively used.

TABLE 4 Row Column transfor- transfor- Code- Transform method mationmation word First transform method 0 0 0 2D transform Fourth transformmethod — — 1

Table 4 illustrates a set of transform methods used for the third intraprediction mode group, in which one of the two transform methods otherthan the second transform method of performing only row transformationand the third transform method of performing only column transformationmay be selectively used.

The foregoing embodiment is provided for illustrative purposes only, anda mapping relationship between an intra prediction mode group and atransform method may be changed variously.

FIG. 7 illustrates a method of reassigning a codeword depending on anintra prediction mode according to an exemplary embodiment of thepresent invention.

Referring to FIG. 7, codewords which are assigned to transform methodsmay vary according to intra prediction mode groups.

Since a first intra prediction mode group 700 is more likely to use thesecond transform method of performing only row transformation, thesecond transform method is assigned to a shorter codeword than the thirdtransform method to enhance encoding efficiency. Alternatively, acodeword which is assigned to the second transform method is mapped to ashortest codeword and a codeword which is assigned to the thirdtransform method is mapped to a longest codeword, thereby enhancingencoding efficiency.

In this way, the first intra prediction mode group 700, a second intraprediction mode group 720 and a third intra prediction mode group 740may perform encoding according to codewords using different mappingtables, a first mapping table 710, a second mapping table 730 and athird mapping table 750, respectively. That is, different codewords aremapped with transform methods depending on intra prediction mode groups,thereby enhancing encoding and decoding efficiency.

Table 5 illustrates codewords mapped with the respective transformmethods for the second intra prediction mode group.

TABLE 5 Row Column transfor- transfor- Code- Transform method mationmation word First transform method 0 0 0 2D transform Second transformmethod 0 — 001 1D transform Third transform method — 0 01 1D transformFourth transform method — — 000

Referring to Table 5, since the second intra prediction mode group ismore likely to select the third transform method of performing columntransformation as an optimal method than the second transform method,the third transform method may be assigned to a shorter codeword than acodeword assigned to the second transform method.

FIG. 8 illustrates a scanning mode depending on a transform methodaccording to an exemplary embodiment of the present invention.

Referring to FIG. 8, scanning mode may include horizontal scanning order800, vertical scanning order 820 and diagonal scanning orders 840 and880. In diagonal scanning, different diagonal scanning orders may beused depending on block sizes. Diagonal scanning order 840 may be usedfor a 4×4 block, while diagonal scanning order 860 may be used for ablock larger than a 4×4 block. The scanning orders shown in FIG. 8 areprovided only for illustrative purposes, and alternative scanning ordersmay be also used.

According to the present embodiment, different scanning orders may beused depending on intra prediction modes and sizes of blocks. Forexample, information on a scanning order used for a block may beobtained using a mapping table representing a mapping relationshipbetween an intra prediction mode and a block size and scanning orderbased on input values of an intra prediction mode and a block size.

Further, different scanning orders may be used depending on not onlyinformation on intra prediction modes and sizes of blocks but alsotransform methods to arrange coefficients. For example, in the secondtransform method of performing only row transformation, residual signalsare more likely to remain in the vertical direction, and thus verticalscanning order 820 may be used. In the third transform method ofperforming only column transformation, residual signal are more likelyto remain in the row direction, and thus horizontal scanning order 800may be used. In the transform method of performing both rowtransformation and column transformation, diagonal scanning order 840may be used to transform residual signals.

FIG. 9 is a flowchart illustrating a method of determining a scanningmode depending on a transform method according to an exemplaryembodiment of the present invention.

FIG. 9 illustrates a method of determining a scanning order depending onan intra prediction mode such as intra prediction mode groupinformation. Similarly, as a transform method is determined depending onan intra prediction mode group, the method of determining the scanningorder depending on the transform method may be also included in thepresent embodiment.

Referring to FIG. 9, an intra prediction mode group is determined(S900).

As transform is performed based on an intra prediction mode group,information on an intra prediction mode used for a current transformunit is determined and an intra prediction mode group is determinedaccordingly.

In the first intra prediction mode group (S910), the second transformmethod may be used and vertical (column direction) scanning order may beused for transformed residual information (S940).

In the second intra prediction mode group (S920), the third transformmethod may be used and horizontal (row direction) scanning order may beused for transformed residual information (S950).

In the third intra prediction mode group (S930), the first transformmethod may be used and zigzag (diagonal) scanning order may be used fortransformed residual information (S960).

Although FIG. 9 illustrates that a scanning order is determined for ablock depending on three divided groups of intra prediction modes, intraprediction modes may be further divided into a greater number of groupswithin the scope of the present invention.

Also, as described above, not only the information on the intraprediction mode but a size of a block to be scanned may also be used asa factor for determining a scanning order of a block.

In encoding process, an intra prediction mode may be determined and ascanning order may be determined depending on the determined intraprediction mode. Intra prediction modes may be divided into a pluralityof groups and a scanning order may be determined for each correspondinggroup.

In decoding process, a scanning order may be determined based on anintra prediction mode determined in encoding process, and a block may bereconstructed using the same scanning order as used for encodingprocess. Likewise in decoding process, intra prediction modes may bedivided into a plurality of groups and a scanning order may bedetermined for each corresponding group.

Also, in decoding process, information on a scanning order used inencoding process may be derived based on decoded intra prediction modeinformation and block size information. In decoding process, scanningmay be performed based on the derived information on the scanning methodused in encoding process and the same block as in encoding process maybe generated.

FIG. 10 is a flowchart illustrating a method of determining a scanningmode depending on a transform method according to an exemplaryembodiment of the present invention.

FIG. 10 is a flowchart illustrating a method of determining a scanningmode based on block size information in addition to intra predictionmode information.

Referring to FIG. 10, information on an intra prediction mode of a blockis input (S1000).

Information on an intra prediction mode number may be input, or indexinformation on a corresponding group may be input if the intraprediction mode number is included in a predetermined group.

Information on a size of the block is input (S1010).

The information on the size of the block may be further considered todetermine a scanning order in addition to the information on the intraprediction mode. That is, even in performing intra prediction on blocksusing the same intra prediction mode number, different scanning ordersmay be used depending on sizes of the blocks.

A scanning order of the block is derived based on the information on theintra prediction mode and the information on the size of the block(S1020). A method of scanning the block may be derived on the basis ofthe information on the intra prediction mode and scanning informationinput through S1000 and S1010.

In encoding process, a scanning order for a block may be derived bydetermining an intra prediction mode and a size of a block in aprediction process. In decoding process, a scanning order for a blockmay be derived based on the entropy-decoded information on an intraprediction mode and information on a size of a block.

While exemplary embodiments of the present invention have been shown anddescribed, it would be appreciated by those skilled in the art thatvarious changes may be made to these exemplary embodiments withoutdeparting from the principles and spirit of the invention.

The invention claimed is:
 1. A method of decoding a video signal havinga current block to be decoded with a decoding apparatus, comprising:obtaining prediction samples by performing an intra prediction on thecurrent block based on intra prediction mode information of the currentblock and reference samples adjacent to the current block; obtainingresidual samples of the current block; and reconstructing the currentblock by using the residual samples and the prediction samples, whereinthe obtaining the residual samples comprises: obtaining quantizedcoefficients of the current block from the video signal, obtaininginverse-quantized coefficients of the current block byinverse-quantizing the quantized coefficients; and obtaining, based on atransform skip flag, the residual samples of the current block byselectively performing an inverse-transform on the inverse-quantizedcoefficients of the current block, the transform skip flag specifyingwhether an inverse-transform is performed or skipped on theinverse-quantized coefficients of the current block, wherein when thetransform skip flag specifies that the inverse-transform is performed onthe inverse-quantized coefficients of the current block, obtaining theresidual samples further comprises: determining, based on a size of atransform block relating to the current block, a transform type of thecurrent block among a discrete cosine transform (DCT) or a discrete sinetransform (DST); and performing the inverse-transform for theinverse-quantized coefficients of the current block by using thedetermined transform type.
 2. The method of claim 1, wherein theinverse-transform includes a transform on rows of the current block anda transform on columns of the current block.
 3. The method of claim 1,wherein obtaining the quantized coefficients of the current blockcomprises: determining a scan mode of the current block based on thesize of the transform block relating to the current block and the intraprediction mode of the current block; and obtaining the quantizedcoefficients of the current block by considering a scanning order of thedetermined scan mode.
 4. The method of claim 3, wherein the determinedscan mode is representative of one of a diagonal scan, a vertical scanand a horizontal scan.